/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tool;
import java.awt.event.ActionListener;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

/**
 *
 * @author MyLaptop
 */
public class InitJpanelToTab {
     public static void initJpanelToTab(JTabbedPane tab,JPanel panel,CrossCloseButton button,JPanel panel1,ActionListener action){
       button.addActionListener(action); 
       panel1.add(button);
        panel1.setOpaque(false);
        tab.add(panel);
        tab.setTabComponentAt(tab.getTabCount()-1,panel1);
    }
}
